home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / tcp_ip / os2 / pmnos11s / smtp.h < prev    next >
C/C++ Source or Header  |  1992-10-31  |  3KB  |  96 lines

  1. #ifndef    _SMTP_H
  2. #define    _SMTP_H
  3.  
  4. #define SMTPTRACE            /* enable tracing for smtp */
  5. #define MAXSESSIONS    10        /* most connections allowed */
  6. #define JOBNAME        13        /* max size of a job name with null */
  7. #define    LINELEN        256
  8. #define PLINELEN    256
  9. #define RLINELEN    512
  10. #define TLINELEN    1024
  11. #define SLINELEN    64
  12. #define MBOXLEN        8        /* max size of a mail box name */
  13.  
  14. /* types of address used by smtp in an address list */
  15. #define BADADDR        0
  16. #define LOCAL        1
  17. #define DOMAIN        2
  18. #define NNTP_GATE    3
  19.  
  20. /* a list entry */
  21. struct list {
  22.     struct list *next;
  23.     char *val;
  24.     char type;
  25. };
  26.  
  27. /* Per-session control block  used by smtp server */
  28. struct smtpsv {
  29.     int s;            /* the socket for this connection */
  30.     char *system;        /* Name of remote system */
  31.     char *from;        /* sender address */
  32.     struct list *to;    /* Linked list of recipients */
  33.     FILE *data;        /* Temporary input file pointer */
  34. };
  35.  
  36. /* used by smtpcli as a queue entry for a single message */
  37. struct smtp_job {
  38.     struct     smtp_job *next;    /* pointer to next mail job for this system */
  39.     char    jobname[9];    /* the prefix of the job file name */
  40.     long    len;        /* length of file */
  41.     char    *from;        /* address of sender */
  42.     struct list *to;    /* Linked list of recipients */
  43. };
  44.  
  45. /* control structure used by an smtp client session */
  46. struct smtpcli {
  47.     int     s;        /* connection socket */
  48.     int32    ipdest;        /* address of forwarding system */
  49.     char    *destname;    /* domain address of forwarding system */
  50.     char    *wname;        /* name of workfile */
  51.     char    *tname;        /* name of data file */
  52.     char    buf[LINELEN];    /* Output buffer */
  53.     char    cnt;        /* Length of input buffer */
  54.     FILE    *tfile;
  55.     struct    smtp_job *jobq;
  56.     struct    list     *errlog;    
  57.     int lock;        /* In use */
  58. };
  59.  
  60. /* smtp server routing mode */
  61. #define    QUEUE    1
  62.  
  63. #define    NULLLIST    (struct list *)0
  64. #define    NULLSMTPSV    (struct smtpsv *)0
  65. #define    NULLSMTPCLI    (struct smtpcli *)0
  66. #define NULLJOB        (struct smtp_job *)0
  67.  
  68. extern int Smtpmode;
  69. extern char *Mailspool;
  70. extern char *Maillog;
  71. extern char *Mailqdir;        /* Outgoing spool directory */
  72. extern char *Routeqdir;    /* spool directory for a router program */
  73. extern char *Mailqueue;    /* Prototype of work file */
  74. extern char *Maillock;        /* Mail system lock */
  75. extern char *Alias;        /* File of local aliases */
  76.  
  77. /* In smtpserv.c: */
  78. char *ptime __ARGS((long *t));
  79. long get_msgid __ARGS((void));
  80. char *getname __ARGS((char *cp));
  81. int validate_address __ARGS((char *s));
  82. int queuejob __ARGS((FILE *dfile,char *host,struct list *to,char *from));
  83. struct list *addlist __ARGS((struct list **head,char *val,int type));
  84. int mdaemon __ARGS((FILE *data,char *to,struct list *lp,int bounce));
  85.  
  86. /* In smtpcli.c: */
  87. int smtptick __ARGS((void *t));
  88. int mlock __ARGS((char *dir,char *id));
  89. int rmlock __ARGS((char *dir,char *id));
  90. void del_list __ARGS((struct list *lp));
  91. int32 mailroute __ARGS((char *dest));
  92. extern char *Months[];
  93.  
  94. #endif    /* _SMTP_H */
  95.  
  96.